<style lang="scss" scoped>
    .hover-blue{
        transition: .3s;
        &:hover{
            color:deepskyblue !important;
        }
    }
</style>
<template>
    <div>
        <ui-title class="mt50">热门文章</ui-title>
        <div class="bg-light-white p5">
            <ol>
                <li v-for="item in datalist" class="mb10 f-color-text">
                    <router-link :to="{name:'文章详情',query:{id:item.object_id}}" class="f-color-black hover-blue">{{item.post_title}}</router-link>
                </li>
            </ol>
        </div>
    </div>
</template>
<script>
    export default {
        data(){
            return {
                datalist:[]
            }
        },
        created(){
            this.$http.get('index.php?g=home&m=content&a=get_attr_posts', {
                params:{
                    page_size:10,
                    posttype:0,
                    cid:7
                }
            })
            .then(({data})=>{
                // console.log('热门文章',data)
                if (data.code==1) {
                    this.datalist = data.data
                }
            })
        },
    }
</script>